from openpyxl import load_workbook
import unittest
from day0409.Case.TestCase import TestCase

class Tool():
    def discover(self):
        suite = unittest.defaultTestLoader.discover(start_dir='../', pattern='TestCase.py')
        return suite

    def addtest(self):
        suite=unittest.TestSuite()
        suite.addTest(TestCase('test_01_jiuxian'))

class Tools():
    def __init__(self,path,sheetname):
        self.path=load_workbook(path)
        self.sheetname=self.path[sheetname]


    def getdata(self):
        dlist=[]
        for line in self.sheetname:
            tlist=[]
            tlist.append(line[0].value)
            tlist.append(line[1].value)
            tlist.append(line[2].value)
            tlist.append(line[3].value)
            dlist.append(tlist)
        dlist.pop(0)
        return dlist

if __name__ == '__main__':
    path= r"/one/day0409/Date/login.xlsx"
    sheetname='Sheet1'
    dy=Tools(path,sheetname)
    print(dy.getdata())
